1. Technical Field
The present invention relates in general to the generation and execution of scripts used in a data processing environment, and, in particular, to a method, system, and program for parameter expansion, generation, and execution of scripts in a networked environment using objects.
2. Description of the Related Art
With reference now to FIG. 1, a block diagram of a networked environment 1 is shown. Networked environment 1 illustrates a client system 10 in communication with a server system 15. System administrator 2 inputs parameters of a script 4 into client system 10. Client system 10 passes the parameters to a server system 12. A xe2x80x9cscriptxe2x80x9d is a program which includes a set of instructions to a computer application or program. The instructions use the same set of rules as the application or program. A script may be referred to by a name that defines the set of instructions. Expansion of the script occurs when the instructions are substituted for the name wherever the name appears in the program. A xe2x80x9cshell scriptxe2x80x9d is a script executed by a command interpreter or shell of an operating system.
In FIG. 1, system administrator 2 desires to execute a command to perform an operation (such as a delete, change password, etc.) on an object (such as User Object 15, which either represents user A or B) stored at server system 12. System administrator 2 uses client system 10 to manage, command, and perform a selected operation on a selected object (e.g., object representing either user A or B) that is stored at server system 12 by passing various parameters (e.g., arguments, flags, and values) defined for script 4 from client system 10 to server system 12. Client system 10 calls for execution of the command on server system 12 via communication line 7. Server system 12 receives and performs the command through an Object Request Broker (ORB) 6 located in server system 12.
Execution of script 4 in a networked environment 1 therefore requires pre-knowledge by system administrator 2 of script 4 in a respective language for each particular operating system, such as Windows NT, UNIX, LINUX, etc. System administrator 2 needs to specifically know the arguments, flags, and values and the specific language for script 4, and these parameters are passed by system adminstrator 2 to server system 12 through client system 10.
System administrator 2 manually inputs or types in the respective arguments, flags, and values into client system 10. Client system 10 passes the manually inputted parameters to server system 12 via line communication 8 in order to command and perform the desired operation at server system 12. Graphical User Interface programs on client system 10 help eliminate user input errors. However, programs that receive the parameters and send the request to the server system 12 need to perform the parameter substitution. Such programs, when written in C or Java can be error prone if the script requires a large number of parameters. For example the following sample C and Java code remotely execute a script on a Server system:
The above code compiles correctly, but fails to execute if the programmer omits the xe2x80x98xe2x88x92xe2x80x99 in front of any of the flags.
Easy and flexible management and execution of script 4 in various scripting languages (e.g., text executable code, korn shell, Perl, DOS Bat file, ASCII, etc.) within a networked environment that includes a collection of systems running under different types of operating systems such as Windows NT, UNIX, LINUX, etc. presently does not exist. Therefore, an improved way of remotely implementing a script to execute a command in a networked environment is needed and desired.
It is therefore one object of the present invention to a method, system, and program for parameter expansion, generation, and execution of a script in a networked environment using objects.
It is another object of the present invention to provide a method, system, and program for parameter expansion, generation, and execution of a script that do not require pre-knowledge of the script language and the respective parameters of the script on the client system.
It is a further object of the present invention to provide a method, system, and program for parameter expansion, generation, and execution of a script that do not require script evaluation on the client side and that do not require passing of the script from the client side to the server side.
It is also another object of the present invention to provide a method, system, and program for parameter expansion, generation, and execution of a script that generate and dynamically expand a script and evaluate respective parameters for the script in various programming languages.
It is still a further object of the present invention to provide easy and flexible management and execution of a script in various scripting languages within a networked environment that includes a collection of systems running under different platforms.
The foregoing objects are achieved as is now described. A method, system, and program for generating scripts in a networked environment are disclosed. A shell script is written in a programming language in which the shell script is used in a networked environment. The shell script is programmingly converted to a script executable under a specific platform. The script is executed under the specific platform. A script generating command is defined in the shell script. Parameters for the script generating command are defined. The script generating command is executed with the parameters to generate the script. Prefix names having associated prefix variables that are passed to the script generating command are also defined. The prefix names and the prefix variables are obtained for the script generating command. Values for the prefix variables are retrieved from a table. Easy and flexible management and execution of scripts in various scripting languages within a networked environment that includes a collection of systems running under different platforms are provided by the present invention.
The above as well as additional objects, features, and advantages of the present invention will become apparent in the following detailed written description.